package com.java.datastructures.singlelinkedlist;

/**
 * @author wangning
 * @create 2021-06-01 21:13
 */
public class TestNode {
	public static void main(String[] args) {
		//创建节点
		Node node1 = new Node(1);
		Node node2 = new Node(2);
		Node node3 = new Node(3);
		//追加节点
		node1.append(node2).append(node3).append(new Node(4));
//		node1.append(node3);
		//取出下一个节点
//		System.out.println(node1.next().getData());
		//判断节点是否是最后一个节点
//		System.out.println(node1.next().next().isLast());
		//显示节点信息
		node1.show();
		System.out.println("----------");
		//删除一个节点
		node1.next().removeNext();
		node1.show();
		node1.next().after(new Node(5));
		node1.show();

	}
}
